package webbandidong.bo.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import webbandidong.bo.MobileBO;
import webbandidong.dao.MobileDAO;
import webbandidong.model.Mobile;
import webbandidong.viewmodel.SearchMobileViewModel;

@Service(value = "mobileBOImpl")
public class MobileBOImpl implements MobileBO {

    @Autowired
    private MobileDAO mobileDAO;

    public void setMobileDAO(MobileDAO mobileDAO) {
        this.mobileDAO = mobileDAO;
    }

    public List<Mobile> getAllMobiles() {
        return mobileDAO.getAllMobiles();
    }

    public Mobile getMobileById(int id) {
        return mobileDAO.getMobileById(id);
    }

    public String addMobile(Mobile mobile) {
        return mobileDAO.addMobile(mobile);
    }

    public String updateMobile(Mobile mobile) {
        return mobileDAO.updateMobile(mobile);
    }

    public String deleteMobile(Mobile mobile) {
        return mobileDAO.deleteMobile(mobile);
    }

    public List<Mobile> getMobilesCriteria(SearchMobileViewModel model, int page) {
        return mobileDAO.getMobilesCriteria(model, page);
    }

    public List<Mobile> getMobilesCriteria(SearchMobileViewModel model) {
        return mobileDAO.getMobilesCriteria(model);
    }
}
